package com.github;

import com.github.bean.ServerUser;
import com.github.bean.User;
import com.github.common.constant.MyConstant;
import com.github.manager.Manager;
import com.github.service.UserServer;
import com.github.util.Role;
import com.github.util.SessionSocketHolder;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DataController {
    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @GetMapping("/api/is_server_online")
    public boolean getIsServerOnline(@RequestParam("account") String account) {
       return SessionSocketHolder.isOpen(account, Role.SERVER);
    }
}